# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=easy-creds
pkgver=45.bf9f00c
pkgrel=1
groups=('blackarch' 'blackarch-automation' 'blackarch-networking')
pkgdesc='A bash script that leverages ettercap and other tools to obtain credentials.'
arch=('any')
url='https://github.com/brav0hax/easy-creds'
license=('GPL2')
depends=('bash' 'ettercap' 'dsniff' 'dhcp' 'hostapd' 'ipcalc' 'screen'
         'freeradius' 'hamster' 'sslstrip' 'metasploit' 'mdk3' 'aircrack-ng'
         'asleap')
makedepends=('git')
source=("git+https://github.com/brav0hax/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 755 "$pkgname.sh" "$pkgdir/usr/share/$pkgname/$pkgname.sh"
  install -m 644 definitions.sslstrip \
    "$pkgdir/usr/share/$pkgname/definitions.sslstrip"
  install -Dm 644 README "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec ./$pkgname.sh "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

